package rkdwogus7.practice;

import java.util.*;

public class Ch04_Sil5 {

	public static void main(String[] args) {
		int isLoop = 0;
		Scanner sc = new Scanner(System.in);
		
		while(isLoop != 1) {
			System.out.println("두 정수와 연산기호를 입력하세요");
			int a = sc.nextInt();
			int b = sc.nextInt();
			char c = sc.next().charAt(0);
			
			if (c == '+') {
				Add1 ad = new Add1();
				ad.setValue(a, b);
				System.out.println(ad.claculate());
			}
			else if (c == '-') {
				Sub1 sb = new Sub1();
				sb.setValue(a, b);
				System.out.println(sb.calculate());
			}
			else if (c == '*') {
				Mul1 m = new Mul1();
				m.setValue(a, b);
				System.out.println(m.calculate());
			}
			else if (c == '/') {
				Div1 d = new Div1();
				d.setValue(a, b);
				System.out.println(d.calculate());
			}
			else {
				System.out.println("잘못 입력하셨습니다~!");
			}
		System.out.println("계산을 종료하시려면 1을 입력해 주세요");
		}
		
		sc.close();
	} // main

	
	
	
} // class

class Question {
	int a, b;
	
	public void setValue(int a, int b) {
		this.a = a;
		this.b = b;
	}
}

class Add1 extends Question {
	public int claculate() {
		return a + b;
	}
	
}

class Sub1 extends Question {
	public int calculate() {
		return a - b;
	}

}

class Mul1 extends Question {
	public int calculate() {
		return a * b;
	}

}

class Div1 extends Question {
	public int calculate() {
		return a / b;
	}

}





